# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: db\views\targets_excluded_hours.py
__author__ = "sanyi"
from sqlalchemy import *
from sqlalchemy.orm import mapper
from sqlalchemy.dialects.postgresql import UUID as C_UUID
from sqlalchemy.dialects.postgresql import JSONB as TYPE_JSONB
from db.tables import metadata

TargetsWithExcludedHoursViewTable = Table(
    "targets_excluded_hours",
    metadata,
    Column("target_id", C_UUID, primary_key=True),
    Column(
        "owner_id",
        C_UUID,
        ForeignKey("users.user_id", ondelete="CASCADE"),
        nullable=False,
        index=True,
    ),
    Column(
        "creator_id",
        C_UUID,
        ForeignKey("users.user_id", ondelete="SET NULL"),
        index=True,
    ),
    Column("address", TEXT, nullable=False, index=True),
    Column("description", TEXT, nullable=False, default=""),
    Column("criticality", INTEGER, default=10),
    Column("created", DateTime(true), default="now()"),
    Column("modified", DateTime(true)),
    Column(
        "last_scan_session_id",
        C_UUID(ForeignKey("scans_sessions.scan_session_id", ondelete="SET NULL")),
    ),
    Column("last_scan_id", C_UUID(ForeignKey("scans.scan_id", ondelete="SET NULL"))),
    Column("deleted_at", DateTime(true)),
    Column("xh_data", TYPE_JSONB),
    Column("xh_time_offset", INTEGER, default=0),
    Column("manual_intervention", BOOLEAN),
    Column("verification", TEXT),
    Column("type", TEXT),
    Column("cah", TEXT),
)


class TargetsWithExcludedHoursViewRow(object):
    target_id = None
    owner_id = None
    description = None
    address = None
    criticality = None
    deleted_at = None
    last_scan_session_id = None
    xh_data = None
    xh_time_offset = None
    manual_intervention = None
    cah = None

    def __str__(self):
        return "R_target[%s:%s]=%s" % (self.target_id, self.owner_id, self.address)

    def __repr__(self):
        return self.__str__()


mapper(TargetsWithExcludedHoursViewRow, TargetsWithExcludedHoursViewTable)
